Eclipse Platform
Pre-release 3.0

org.eclipse.team.core.subscribers
Class ComparisonCriteria

java.lang.Object
  extended byorg.eclipse.team.core.subscribers.ComparisonCriteria
Direct Known Subclasses:
ContentComparisonCriteria

public abstract class ComparisonCriteria
extends Object

A ComparisonCriteria used by a TeamSubscriber to calculate the sync state of the workspace resources. Subscribers are free to use the criteria best suited for their environment. For example, an FTP subscriber could choose to use file size or file timestamps as compasison criterias.

Aggregate criterias can be created for cases where a criteria is based on the result of another criteria.

See Also:
SyncInfo, TeamSubscriber

Constructor Summary
ComparisonCriteria()
          Default no-args contructor to be called if the comparison criteria does not depend on other criterias.
ComparisonCriteria(ComparisonCriteria[] preConditions)
          Constructor used to create a criteria whose comparison is based on the compare result of other criterias.
 
Method Summary
protected  boolean checkPreConditions(Object e1, Object e2, IProgressMonitor monitor)
           
abstract  boolean compare(Object e1, Object e2, IProgressMonitor monitor)
          Returns true if e1 and e2 are equal based on this criteria and false otherwise.
abstract  String getId()
          Return the unique id that identified this comparison criteria.
abstract  String getName()
          Return the comparison criteria, in a format that is suitable for display to an end user.
protected  ComparisonCriteria[] getPreConditions()
           
 boolean usesFileContents()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComparisonCriteria

public ComparisonCriteria()
Default no-args contructor to be called if the comparison criteria does not depend on other criterias.


ComparisonCriteria

public ComparisonCriteria(ComparisonCriteria[] preConditions)
Constructor used to create a criteria whose comparison is based on the compare result of other criterias.

Parameters:
preConditions - array of preconditions
Method Detail

getName

public abstract String getName()
Return the comparison criteria, in a format that is suitable for display to an end user.


getId

public abstract String getId()
Return the unique id that identified this comparison criteria.


compare

public abstract boolean compare(Object e1,
                                Object e2,
                                IProgressMonitor monitor)
                         throws TeamException
Returns true if e1 and e2 are equal based on this criteria and false otherwise. Since comparison could be long running the caller should provide a progress monitor.

Parameters:
e1 - object to be compared
e2 - object to be compared
monitor -
Returns:
Throws:
TeamException

getPreConditions

protected ComparisonCriteria[] getPreConditions()
Returns:

checkPreConditions

protected boolean checkPreConditions(Object e1,
                                     Object e2,
                                     IProgressMonitor monitor)
                              throws TeamException
Throws:
TeamException

usesFileContents

public boolean usesFileContents()

Eclipse Platform
Pre-release 3.0

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.